#ifndef STATISTICS_FOR_DATE_H
#define STATISTICS_FOR_DATE_H

#include <QWidget>
#include "histogram_manager.h"
namespace Ui {
class StatisticsForDate;
}
enum HistogramType{
    YearAndXForMonth = 0,//本年度,刻度为月
    Month,//月度,刻度为日
    AllDate,//所有数据
    Screen,//筛选日期,日期大于100按月统计
    UserYser,
    UserMonth
};
class StatisticsForDate : public QWidget
{
    Q_OBJECT

public:
    explicit StatisticsForDate(QWidget *parent = nullptr);
    ~StatisticsForDate();
    void CreateHistogram(HistogramType type = YearAndXForMonth,QString start = "",QString end = "");
    //X轴一定是时间，Y轴一定是多少个
    void createOthers(QString chartname ,QMap<QString,int> data,bool showCombobox = false);
    void createOthers(QString chartname ,QString start,QString end );
    void createUsers(QString chartname ,QString start,QString end);
    void setCombox(QSet<QString>);
    void setNowTable(HistogramType table = YearAndXForMonth);
private:
    Ui::StatisticsForDate *ui;
    QChartView *view;
    HistogramType tableType;
public slots:
    void signOtherChart(QString,QMap<QString , int>);
private slots:
    void on_comboBox_currentIndexChanged(const QString &arg1);

private:
    void createYearAndXForMonth();
    void createMonth();
    void createEmployeeYear();
    void createEmployeeMonth();
    void hideUi();

};

#endif // STATISTICS_FOR_DATE_H
